#Author:Math2Gold ( http://groups.google.com/group/math2gold ) 
#Last update:2009 Sep 11

import urllib
import urllib2
import urlparse
import default_m2g_conf 
import m2g_misc
import logging

print 'Content-type:text/plain'
print ''

params = urllib.urlencode(
                          {'hub.callback': default_m2g_conf.sub_callback, 
                           'hub.topic': default_m2g_conf.rss, 
                           'hub.verify': 'sync',
                           'hub.mode':'subscribe',
                           'hub.verify_token':'',
                           'hub.secret':''})

user_agent = 'Math2Gold Messager'
headers = { 'User-Agent' : user_agent }
req = urllib2.Request(default_m2g_conf.rss_hub,params,headers)
op = urllib2.build_opener()
try:
    response = urllib2.urlopen(req)
    document = response.read()
except:
    pass


